<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
  <title>欢迎使用领捷智慧物流管理系统</title>
  <link rel="hshortcut icon" href="../static/img/own/head.png"/>
  <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
  <link rel="stylesheet" href="/static/fonts/fontawesome-all.min.css">
  <link rel="stylesheet" href="/static/css/animate.min.css">
</head>

<body id="page-top">
<div id="wrapper">
  <div class="d-flex flex-column" id="content-wrapper">
    <div id="content">
      <div>
        <div class="container-fluid">
          <div class="card shadow" style="background: rgba(255,255,255,0.1);">
            <div class="card-header py-3" style="height: auto;">
              <div class="row" style="width: auto;height: auto;">
                <div class="col d-inline-flex" style="border-radius: 48px;height: 50px;">
                  <div class="btn-group" role="group">
                    <button class="btn btn-primary" type="button" id="insertWarehouse" style="width: 120px;">新建仓库</button>
<!--                    <button class="btn btn-primary" type="button" style="margin-left: 5px;width: 120px;">删除</button>-->
                  </div>
                </div>
              </div>
            </div>
            <div class="card-body">
              <div class="table-responsive table-bordered d-inline-flex my-auto table mt-2" id="dataTable-1" role="grid" aria-describedby="dataTable_info" style="border-width: 0px;">
                <table class="table table-bordered table-hover my-0" id="dataTable">
                  <tbody class="d-inline-flex flex-column">
                  <tr class="d-inline-flex flex-row justify-content-start flex-wrap" id="warehouseTable" style="margin-left: 0px;padding: 0px;padding-left: 20px;">

                  </tr>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
        </div>
      </div>

    <footer class="bg-white sticky-footer">
      <div class="container my-auto">
        <div class="text-center my-auto copyright"><span>鄂ICP备2021022432号</span></div>
      </div>
    </footer>
    </div><a class="border rounded d-inline scroll-to-top" href="#page-top"><i class="fas fa-angle-up"></i></a>
  </div>
</div>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
<script src="/static/js/chart.min.js"></script>
<script src="/static/js/bs-init.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.js"></script>
<script src="/static/js/script.min.js"></script>
<script src="/static/js/theme.js"></script>
<script src="/static/js/jquery.session.js"></script>

<script>
  $(document).ready(function (){
    $.ajax({
      url: "/warehouse/findAllWarehouse",
      type: 'post',
      dataType:"json",
      success:function (result){
        let str = "";
        for(let i = 0; i < result.length; i++){

          str += "<td class=\"text-center\" style=\"padding: 15px;margin: 10px;\">\n" +
                  "                      <div class=\"card border rounded d-inline-flex flex-row flex-grow-0\" data-bs-hover-animate=\"pulse\" style=\"width: 250px;height: 200px;margin: 0px;background: #00b5d6;padding: 18px;\" href=\"index.html\">\n" +
                  "                        <div class=\"card-body d-inline-flex\" style=\"width: 100%;height: 100%;margin: 0px;min-height: auto;border-radius: 65px;border-width: 2px;\">\n" +
                  "                          <div class=\"row\">\n" +
                  "                            <div class=\"col\" style=\"width: auto;\">\n" +
                  "                              <div class=\"d-inline-flex flex-column justify-content-center align-items-center\" style=\"width: 100%;height: 100%;\"><span class=\"d-inline-flex align-items-start\" style=\"color: rgb(255,255,255);width: 165px;margin-top: -30px;margin-bottom: 19px;\">"+(Number(i)+Number(1))+"</span><span class=\"d-inline-flex align-items-center\" style=\"color: rgb(255,255,255);font-size: 32px;font-family: Aclonica, sans-serif;\">"+ result[i].housename +"</span>\n" +
                  "                                <a\n" +
                  "                                        class=\"d-inline-flex align-items-end\" href=\"/warehouse/toShelf?houseid="+result[i].houseid+"&housename="+result[i].housename+"\" style=\"color: rgb(255,255,255);margin-top: 7px;\">进入</a>\n" +
                  "                              </div>\n" +
                  "                            </div>\n" +
                  "                          </div>\n" +
                  "                        </div>\n" +
                  "                      </div>\n" +
                  "                    </td>"
        }
        $("#warehouseTable").append(str);
      }
    })
  })

  $(function (){
    $("#insertWarehouse").on("click",function (){
      $(location).attr("href","/page/toWarehouseAdd");
    })
  })

  //session
  $.session.set("url",window.location.href);
</script>

</body>
</html>